import requests from './request'
// 根据电影id获取详情
export const getMovieById = (mId) => requests({ url: '/movie/getMovieById/' + mId, method: 'post' })

// 收藏电影
export const BeLike = (mId) => requests({ url: '/MyLike/insertByusername/' + mId, method: 'post' })

// 取消收藏电影
export const NotLike = (mId) => requests({ url: `/MyLike/deleteByusername/${mId}`, method: 'post' })

// 获取用户是否收藏电影
export const getBeLiked = (mId) => requests({ url: '/MyLike/getLikeByUserNameAndMId', params: { mId: mId }, method: 'post' })

// 获取电影平均分
export const getScoreByMId = (mId) => requests({ url: '/comment/getScoreByMId/' + mId, method: 'get' })

// 获取所有电影类型
export const getMovieType = () => requests({ url: '/movie/getAllMovieType', method: 'get' })

// 获取即将上映的电影数量
export const getComingSoonMovieCount = () => requests({ url: '/movie/getComingSoonMovieCount', method: 'get' })

// 获取正在热映的电影数量
export const getHotMovieCount = () => requests({ url: '/movie/getHotMovieCount', method: 'get' })

// 获取票房信息
export const getDailyBoxOfficeStats = () => requests({ url: '/movie/dailyBoxOfficeStats', method: 'post' })

// 获取首页热映电影信息
export const getHotMovie = () => requests({ url: '/movie/index/getHotMovie', method: 'post' })

// 获取首页即将上映电影信息
export const getComingSoonMovie = () => requests({ url: '/movie/index/getComingSoonMovie', method: 'post' })
